<div class="row" ng-controller="bs_book_recommendCtrl">
    <div class="col-md-9">

        <div class="row">
            <div class="col-md-6 hidden-xs">
                <ol class="breadcrumb">
                    <li class="active">图书主页</li>
                </ol>
            </div>
            <div class="col-md-6">
                <div class="btn-group pull-right">
                    <a class="btn btn-default" ng-click="scrollToHash('图书漂流')">图书漂流</a>
                    <a class="btn btn-default" ng-click="scrollToHash('旧书转让')">旧书转让</a>
                    <a class="btn btn-default" ng-click="scrollToHash('附近同学')">附近同学</a>
                    <a class="btn btn-default" ng-click="scrollToHash('求书公告')">求书公告</a>
                    <a type="button" class="btn btn-default btn-info"
                       ng-click="chooseMajor()">其他专业
                    </a>
                </div>
            </div>
        </div>

        <!-- 新书速递-->
        <div class="row" ng-if="LatestBook.books.length>0">
            <div class="col-md-12">
                <h4><a ui-sref="book.book-list({cmd:'latest'})">新书速递</a></h4>
                <hr>
            </div>
            <div class="col-md-3" ng-repeat="bookInfo in LatestBook.books.slice(0,8)">
                <bs-one-book-info book-info="bookInfo"
                                  should-show-used-books-count="true"
                                  popover-placement="right"></bs-one-book-info>
            </div>
        </div>

        <!-- 附近用户上传的书漂流-->
        <div class="row" id="图书漂流" ng-if="BookRecommend$.NearCircleBook.circleBooks.length>0">
            <div class="col-md-12">
                <h4><a ui-sref="book.used-book-list({cmd:'nearCircle'})">图书漂流-免费送</a></h4>
                <hr>
            </div>
            <div class="col-md-3" ng-repeat="circleBook in BookRecommend$.NearCircleBook.circleBooks.slice(0,8)">
                <bs-one-used-book used-book="circleBook" popover-placement="right"></bs-one-used-book>
            </div>
        </div>

        <!-- 附近用户上传的旧书-->
        <div class="row" id="旧书转让" ng-if="BookRecommend$.NearUsedBook.usedBooks.length>0">
            <div class="col-md-12">
                <h4><a ui-sref="book.used-book-list({cmd:'nearUsed'})">旧书转让</a></h4>
                <hr>
            </div>
            <div class="col-md-3" ng-repeat="usedBook in BookRecommend$.NearUsedBook.usedBooks.slice(0,8)">
                <bs-one-used-book used-book="usedBook" popover-placement="right"></bs-one-used-book>
            </div>
        </div>

        <!-- 附近用户发布的求书-->
        <div id="求书公告" class="row" ng-if="BookRecommend$.NearNeedBook.needBooks.length>0">
            <div class="col-md-12">
                <h4><a ui-sref="book.used-book-list({cmd:'nearNeed'})">求书公告</a></h4>
                <hr>
            </div>
            <div class="col-md-3" ng-repeat="needBook in BookRecommend$.NearNeedBook.needBooks.slice(0,8)">
                <bs-one-used-book used-book="needBook"
                                  popover-placement="right"></bs-one-used-book>
            </div>
        </div>

        <!-- 根据专业推荐的书-->
        <div id="专业推荐" class="row" ng-if="BookRecommend$.TagBook.books.length>0">
            <div class="col-md-12">
                <h4><a ui-sref="book.book-list({cmd:'tag',tag:major})">专业推荐</a></h4>
                <hr>
            </div>
            <div class="col-md-3" ng-repeat="bookInfo in BookRecommend$.TagBook.books.slice(0,8)">
                <bs-one-book-info book-info="bookInfo"
                                  should-show-used-books-count="true"
                                  popover-placement="right"></bs-one-book-info>
            </div>
        </div>

    </div>

    <aside class="col-md-3 hidden-sm hidden-xs">

        <!-- 微信消息图文-->
        <div class="row" ng-if="WechatNews$.newsList.length>0">
            <div class="col-md-12" style="height: 150px;overflow: hidden;margin-bottom: 10px">
                <carousel interval="4000">
                    <slide ng-repeat="news in WechatNews$.newsList">
                        <a target="_blank" ng-href="{{news.attributes.url}}">
                            <img style="width: 100%"
                                 ng-src="{{news.attributes.thumbImageFile.url()}}">

                            <div class="carousel-caption">
                                <h4 ng-bind="news.attributes.title"></h4>
                            </div>
                        </a>
                    </slide>
                </carousel>
            </div>
        </div>

        <div class="row">
            <div class="col-md-12">
                <h4>图书分类</h4>
                <hr>
                <tabset type="tabs">
                    <tab ng-repeat="bigTag in BookRecommend$.BookTag.getTagAttrNames()" heading="{{bigTag}}">
                        <a class="btn btn-link btn-sm" style="margin: 5px"
                           ng-repeat="littleTag in BookRecommend$.BookTag.tag[bigTag]"
                           ng-bind="littleTag"
                           ui-sref="book.book-list({cmd:'tag',tag:littleTag})"></a>
                    </tab>
                </tabset>
            </div>
        </div>

        <!-- 用户附近的用户-->
        <div id="附近同学" class="row" ng-if="BookRecommend$.NearUser.users.length>0">
            <div class="col-md-12">
                <h4><a ui-sref="common.user-list({cmd:'near'})">附近同学</a></h4>
                <hr>
            </div>
            <div class="col-md-4" ng-repeat="user in BookRecommend$.NearUser.users.slice(0,24)">
                <bs-one-user ng-if="user.attributes.avatarUrl"
                             user="user"
                             image-size="132"
                             margin="20"
                             popover-placement="left"
                             avatar-size="66"></bs-one-user>
            </div>
        </div>

        <div class="row" ng-include="'html/directive/shuxun-wechat-ad.html'"></div>
    </aside>
</div>
